<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>
<body>
    <div id='app'>
        {{msg}}
        <modu></modu>
        <sec></sec>
    </div>
    <script type='text/javascript'>
        Vue.component('modu',{
            data() {
                return {
                    msg: '传智播客',
                    sty: {

                    }
                }
            },
            template: '<button @click="aa" :class="">{{msg}}</button>',
            methods: {
                aa() {
                    this.msg = '这是第一个组件'
                }
            }
        })
        Vue.component('sec',{
            data() {
                return {
                    msg: 0
                }
            },
            template: '<button @click="aa">件数：{{msg}}</button>',
            methods: {
                aa() {
                    this.msg++
                }
            }
        })
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue'
            }
        });
    </script>
</body>
</html>